<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.baoku.wap.dao.*"  %>
<%@ page import="com.baoku.wap.entity.*" %>
<%@ include file="session.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Cache-control" content="no-cache"/>
<style type="text/css">
* { font-size:12px; }
body, div, p, img, form, input { margin:0; padding:0; line-height:22px; font-size:13px;}
a { text-decoration:none; }
a:hover, a:active, a:focus { text-decoration:underline; }
input { vertical-align:middle; line-height:22px; }
.logo{ height:25px;background:#CED7E6}
.login_nav { padding:2px 0 2px 5px; color:#fff; background:#811C40; border-top:1px solid #681432; border-bottom:1px solid #681432; }
.login_nav a { color:#fff; }
.main_nav { padding:0 0 0 5px; border-top:2px solid #DDDBC1; background:#EFEDD3; color:#C1540E; }
.main_nav a { color:#C1540E; }
.main_nav td { width:40px; }
.main_nav .big { font-size:14px; }
.warp_1 { border-bottom:1px solid #02725C; border-top:1px solid #02725C; }
.title_1 { background:url(images/icon_1.gif) no-repeat #0C957A 5px 8px; border-top:1px solid #14AD8F; border-bottom:1px solid #14AD8F; padding:0 0 0 14px; line-height:22px; color:#83FFE7; }
.qa_1 { padding:2px 0 2px 5px; background:#DDEBF9; }
.qa_1 .a_q { color:#063456; }
.qa_1 .a_c { color:#0A8B00; }
.qa_2 { padding:2px 0 2px 5px; background:#EDF5FB; border-bottom:1px dashed #BFD7EB; border-top:1px dashed #BFD7EB;}
.qa_2 .a_q { color:#063456; }
.qa_2 .a_c { color:#0A8B00; }
.warp_2 { border-bottom:1px solid #044674; border-top:1px solid #044674; }
.title_2 { background:url(images/icon_2.gif) no-repeat 5px 8px #065A97; border-top:1px solid #1278BB; border-bottom:1px solid #1278BB; padding:0 0 0 14px; line-height:22px; color:#B3E3FF; }
.title_3 { background:#B3CDE2; padding:2px 0 2px 5px; color:#065A97; }
.title_3 a { color:#065A97; }
form { background:#DDEBF9; border-top:1px dashed #BFD7EB; padding:2px 0 2px 5px; }
form .tex { border:1px solid #6891AF; padding:0 0 0 5px; height:18px;}
.login_nav_footer { padding:2px 0 2px 5px; color:#065A97; border:1px solid #C1D9EB; }
.login_nav_footer a { color:#065A97; }
.us_footer { background:#EDF5FB; color:#065A97; padding:2px 0 2px 5px; border-bottom:3px solid #0E6AAB; }
.us_footer a { color:#065A97; }
.footer { padding:2px 0 2px 5px; color:#065A97; background:url(images/bg_footer.jpg) repeat-x #E4F1FA; height:30px;}
</style>
<title>宝酷网首页</title>
</head>
<body>
<div class="logo"><img src="images/logo.gif" alt="宝酷网" width="240" height="25" /></div>
<% if (login == false) {%> 
<div class="login_nav">[<a href="class.jsp">随意看看</a>][<a href="reg.jsp">免费注册</a>][<a href="login.jsp">登录</a>]</div>
<% } else {%>
<div class="login_nav">欢迎您:<%=(String)session.getAttribute("id") %> <br />
[<a href="class.jsp">随意看看</a>][<a href="mylist.jsp">我的收藏夹</a>][<a href="exit.jsp">退出</a>]</div>
<% } %>
<div class="main_nav">
  <table>
    <tr>
      <td><a href="class.jsp#快讯">&gt;快讯</a></td>
      <td><a href="class.jsp#便览">&gt;便览</a></td>
      <td><a href="class.jsp#新知">&gt;新知</a></td>
      <td><a href="class.jsp#热点">&gt;热点</a></td>
      <td rowspan="2"><a href="class.jsp#精品" class="big">&gt;精品</a></td>
    </tr>
    <tr>
      <td><a href="class.jsp#发烧">&gt;发烧</a></td>
      <td><a href="class.jsp#健美">&gt;健美</a></td>
      <td><a href="class.jsp#友爱">&gt;友爱</a></td>
      <td><a href="class.jsp#酷评">&gt;酷评</a></td>
    </tr>
  </table>
</div>
<div class="warp_1">
  <div class="title_1">宝酷推荐</div>
</div>
<%
	int i = 1;
	ArrayList prime = (ArrayList)new CachFactory().getindexPrime();
	Iterator it =prime.iterator();
	while(it.hasNext()){
		Title title = (Title)it.next();
%>
	<div <%if(i>0){
			out.print("class='qa_1'");
		   }else{
		    out.print("class='qa_2'");
		   }
		 %>><img src="images/icon_list.gif" width="12" height="9" /><a href="inner.jsp?id=<%=title.getId() %>" class="a_q">&nbsp;<%=title.getTitle() %></a></div>
<% i = i*(-1);}%>
<div class="warp_2">
  <div class="title_2">宝酷排行</div>
</div>
<div class="title_3">[<a href="cachlist.jsp?til=pop"><strong>最热问题</strong></a>][<a href="cachlist.jsp?til=new">最新问题</a>]</div>
<%	
	ArrayList pop = (ArrayList)new CachFactory().getindexPop();
	Iterator it2 = pop.iterator();
	while(it2.hasNext()){
		Title title = (Title)it2.next();
%>
	<div <%if(i>0){
			out.print("class='qa_1'");
		   }else{
		    out.print("class='qa_2'");
		   }
		 %>><img src="images/icon_list.gif" width="12" height="9" /><a href="inner.jsp?id=<%=title.getId() %>" class="a_q">&nbsp;<%=title.getTitle() %></a></div>
<% i = i*(-1);}%>
<form action="findlist.jsp">
  <p>
    <input name="tf" type="text" value="查找问题" class="tex"/>
    <input type="image" src="images/btn.gif" />
  </p>
</form>
<div class="login_nav_footer">[<a href="class.jsp">随意看看</a>][<a href="reg.jsp">免费注册</a>][<a href="login.jsp">登录</a>]</div>
<div class="us_footer"><a href="#">设为书签</a>&nbsp;<a href="#">在线帮助</a>&nbsp;<a href="#">关于我们</a></div>
<div class="footer">copyright</div>
</body>
</html>
